#pragma once

#include <list>
#include "dataStruct.h"
// CSeverSocket command target



class CClientSocket : public CSocket
{
public:
	CClientSocket(callBack pCallBack= NULL);
	virtual ~CClientSocket();
public:
	virtual void OnReceive(int nErrorCode);
	virtual void OnClose(int nErrorCode);
	void  send(const netData& sendData);
private:
	callBack m_pCallBackFun;
};

class CSeverSocket : public CSocket
{
public:
	CSeverSocket(callBack pCallBack= NULL);
	virtual ~CSeverSocket();

public:
	virtual void OnAccept(int nErrorCode);
	void sendToAll(const netData& sendData);
private:
    vector<CClientSocket*> m_connectionList;
	callBack m_pCallBackFun;
};


